Skip to content

Update botan.py#108

Open
spontanurlaub wants to merge 1 commit intobotanio:masterfrom
spontanurlaub:master
Open

Update botan.py#108
spontanurlaub wants to merge 1 commit intobotanio:masterfrom
spontanurlaub:master

Conversation

@spontanurlaub
Copy link

@spontanurlaub spontanurlaub commented Jan 2, 2018

Class to store the botan_token, message_wrapper for python-telegram-bot.

Hello,

I created a class to store the botan_token for further use. It's now possible to initialize this class at the beginning of the program and use it in the whole program, without entering the botan_token again.

I also added the decorator for functions that handle python-telegram-bot updates. Example code for that:

`from botan import Botan
from telegram.ext import Updater, MessageHandler

updater = Updater("telegram_token")
botan = Botan("botan_token")

@botan.track_message
def echo(bot, update):
update.message.reply_text(update.message.text)

updater.dispatcher.add_handler(...)
...`

I hope I can help!

Best regards,

Jannik

Class to store the botan_token, message_wrapper for python-telegram-bot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant